package com.yycx.module.bus.provider.handler.haiying.common;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.model.PageParams;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.common.security.OpenHelper;
import com.yycx.module.bus.client.entity.BusCustomAddress;
import org.springframework.stereotype.Component;

/**
 * 收货地址选择
 *
 * @author zyf
 */
@Component
public class CustomAddressSelectPageListHandler implements PageInterceptor<BusCustomAddress> {


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery<BusCustomAddress> cq, PageParams pageParams, EntityMap params) {
        //只查看当前账套
        cq.eq(true, "bca.companyId", OpenHelper.getCompanyId());

    }

}
